How to calculate the sample variance for a set of values